package com.yanqu.road.server;

import com.yanqu.road.NettyMgr;
import com.yanqu.road.dao.db.DBTableInfoMgr;
import com.yanqu.road.dao.db.DbNameStrategy;
import com.yanqu.road.entity.CkOrderBy;
import com.yanqu.road.entity.CkPartition;
import com.yanqu.road.entity.CkSkuId;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.entity.enums.ePlayerAttrType;
import com.yanqu.road.reids.subpub.RedisSubPubRunner;
import com.yanqu.road.server.agent.AgentInterfaceMgr;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.activity.tomb.TombMgr;
import com.yanqu.road.server.gameplayer.module.cricket.CricketMgr;
import com.yanqu.road.server.gameplayer.module.player.PlayerModule;
import com.yanqu.road.server.handle.GameServerHandler;
import com.yanqu.road.server.manger.*;
import com.yanqu.road.server.manger.RecoveryReward.RecoveryRewardMgr;
import com.yanqu.road.server.manger.activity.*;
import com.yanqu.road.server.manger.activity.able.ActivityAbleMgr;
import com.yanqu.road.server.manger.activity.ad.AdActivityMgr;
import com.yanqu.road.server.manger.activity.advertisement.AdvertisementActivityMgr;
import com.yanqu.road.server.manger.activity.apprentice.ApprenticeMgr;
import com.yanqu.road.server.manger.activity.area.AreaWasePkMgr;
import com.yanqu.road.server.manger.activity.assistantcostumemall.AssistantCostumeMallActivityMgr;
import com.yanqu.road.server.manger.activity.auto.reward.ActivityAutoRewardMgr;
import com.yanqu.road.server.manger.activity.auto.send.AutoSendActivity;
import com.yanqu.road.server.manger.activity.biaoju.BiaoJuConfigMgr;
import com.yanqu.road.server.manger.activity.bowart.BowArtMgr;
import com.yanqu.road.server.manger.activity.bulletscreen.ActivityBulletScreenMgr;
import com.yanqu.road.server.manger.activity.businessdepart.BusinessDepartMgr;
import com.yanqu.road.server.manger.activity.businessreunion.BusinessReunionActivityMgr;
import com.yanqu.road.server.manger.activity.businessreunion.BusinessReunionMgr;
import com.yanqu.road.server.manger.activity.busyfarming.BusyFarmingMgr;
import com.yanqu.road.server.manger.activity.carptrip.CarpTripMgr;
import com.yanqu.road.server.manger.activity.cat.CatMgr;
import com.yanqu.road.server.manger.activity.celebration.CelebrationMgr;
import com.yanqu.road.server.manger.activity.channelmusicroomrank.ChannelMusicRoomRankActivityMgr;
import com.yanqu.road.server.manger.activity.chat.ActivityChatMgr;
import com.yanqu.road.server.manger.activity.chefduel.ChefDuelActivityMgr;
import com.yanqu.road.server.manger.activity.chefduel.ChefDuelMgr;
import com.yanqu.road.server.manger.activity.chefduel.ChefDuelPhase1Mgr;
import com.yanqu.road.server.manger.activity.climbtower.ClimbTowerMgr;
import com.yanqu.road.server.manger.activity.commonteam.CommonTeamMgr;
import com.yanqu.road.server.manger.activity.commonwish.CommonWishMgr;
import com.yanqu.road.server.manger.activity.cookboy.CookBoyActivityMgr;
import com.yanqu.road.server.manger.activity.cookboy.CookBoyMgr;
import com.yanqu.road.server.manger.activity.cookboy.OtherActivityBoyActivityMgr;
import com.yanqu.road.server.manger.activity.crosspasture.CrossPastureMgr;
import com.yanqu.road.server.manger.activity.curio.CurioConfigMgr;
import com.yanqu.road.server.manger.activity.curio.CurioMgr;
import com.yanqu.road.server.manger.activity.dafuweng.DaFuWengMgr;
import com.yanqu.road.server.manger.activity.daomu.DaoMuActivityMgr;
import com.yanqu.road.server.manger.activity.diggold.DigGoldMgr;
import com.yanqu.road.server.manger.activity.douluodalu.DouLuoDaLuMgr;
import com.yanqu.road.server.manger.activity.dragonboatrace.DragonBoatRaceMgr;
import com.yanqu.road.server.manger.activity.drawPictures.DrawPicturesActivityMgr;
import com.yanqu.road.server.manger.activity.eggs.EggsActivityMgr;
import com.yanqu.road.server.manger.activity.evefeast.EveFeastMgr;
import com.yanqu.road.server.manger.activity.fanxiuspring.FanXiuSpringMgr;
import com.yanqu.road.server.manger.activity.feast.ShanHeFeastMgr;
import com.yanqu.road.server.manger.activity.fellingtrees.FellingTreesMgr;
import com.yanqu.road.server.manger.activity.flowercard.FlowerCardsMgr;
import com.yanqu.road.server.manger.activity.foxcard.FoxCardMgr;
import com.yanqu.road.server.manger.activity.fund.ActivityFundMgr;
import com.yanqu.road.server.manger.activity.gashapon.GashaponMgr;
import com.yanqu.road.server.manger.activity.ghost.GhostMgr;
import com.yanqu.road.server.manger.activity.goddess.GoddessMgr;
import com.yanqu.road.server.manger.activity.goldautumn.GoldAutumnMgr;
import com.yanqu.road.server.manger.activity.goldingotfund.GoldIngotFundMgr;
import com.yanqu.road.server.manger.activity.gourdchild.GourdChildMgr;
import com.yanqu.road.server.manger.activity.gourdplant.GourdPlantMgr;
import com.yanqu.road.server.manger.activity.greattrade.GreatTradeMgr;
import com.yanqu.road.server.manger.activity.guagifts.GuaGiftsMgr;
import com.yanqu.road.server.manger.activity.guguoxunbao.GuGuoXunBaoMgr;
import com.yanqu.road.server.manger.activity.hanghai.HangHaiMgr;
import com.yanqu.road.server.manger.activity.harps.HarpsMgr;
import com.yanqu.road.server.manger.activity.hell.HellMgr;
import com.yanqu.road.server.manger.activity.hongxian.HongXianActivityMgr;
import com.yanqu.road.server.manger.activity.horserun.HorseRunMgr;
import com.yanqu.road.server.manger.activity.hsisland.HsIslandActivityMgr;
import com.yanqu.road.server.manger.activity.huashigang.HuaShiGangMgr;
import com.yanqu.road.server.manger.activity.iceservergift.IceServerGiftMgr;
import com.yanqu.road.server.manger.activity.jinli.JinLiMgr;
import com.yanqu.road.server.manger.activity.jiuzhou.JiuZhouMgr;
import com.yanqu.road.server.manger.activity.jumppot.HotpotJumpMgr;
import com.yanqu.road.server.manger.activity.langyabang.LangYaBangMgr;
import com.yanqu.road.server.manger.activity.langyamemorial.LangYaMemorialMgr;
import com.yanqu.road.server.manger.activity.lanruosi.LanRuoSiMgr;
import com.yanqu.road.server.manger.activity.liondance.LionDanceMgr;
import com.yanqu.road.server.manger.activity.luckydraw.LuckyDrawMgr;
import com.yanqu.road.server.manger.activity.luckyshop.LuckyShopMgr;
import com.yanqu.road.server.manger.activity.mall.ActivityRmbMallTouchMgr;
import com.yanqu.road.server.manger.activity.mammonhall.MammonHallMgr;
import com.yanqu.road.server.manger.activity.memorypieces.MemoryPiecesMgr;
import com.yanqu.road.server.manger.activity.monjinlottery.SelectLotteryMgr;
import com.yanqu.road.server.manger.activity.musicroomrank.MusicRoomRankActivityMgr;
import com.yanqu.road.server.manger.activity.newserverwelfare.NewServerWelfareMgr;
import com.yanqu.road.server.manger.activity.newyearbag.NewYearBagMgr;
import com.yanqu.road.server.manger.activity.oldplayerreturn.OldPlayerReturnMgr;
import com.yanqu.road.server.manger.activity.operamask.OperaMaskMgr;
import com.yanqu.road.server.manger.activity.orewar.OreWarActivityMgr;
import com.yanqu.road.server.manger.activity.orewar.OreWarActivityRankMgr;
import com.yanqu.road.server.manger.activity.orewar.OreWarMgr;
import com.yanqu.road.server.manger.activity.pasture.PastureMgr;
import com.yanqu.road.server.manger.activity.pawnshop.PawnshopMgr;
import com.yanqu.road.server.manger.activity.peakseacraft.PeakSeacraftMgr;
import com.yanqu.road.server.manger.activity.peakstronghold.PeakStrongholdActivityMgr;
import com.yanqu.road.server.manger.activity.pixiu.PiXiuActivityMgr;
import com.yanqu.road.server.manger.activity.platform.IntroductionShieldMgr;
import com.yanqu.road.server.manger.activity.platform.PlatformActivityMgr;
import com.yanqu.road.server.manger.activity.platform.PlatformMailAntiActivityMgr;
import com.yanqu.road.server.manger.activity.qixi.QixiMgr;
import com.yanqu.road.server.manger.activity.qqprivilege.QQPrivilegeMgr;
import com.yanqu.road.server.manger.activity.rankunionwar.RankUnionWarMgr;
import com.yanqu.road.server.manger.activity.recallplayer.RecallPlayerMgr;
import com.yanqu.road.server.manger.activity.recycle.ActivityItemRecycleMgr;
import com.yanqu.road.server.manger.activity.ruishou.RuiShouMgr;
import com.yanqu.road.server.manger.activity.seacraft.SeacraftPirateRiotMgr;
import com.yanqu.road.server.manger.activity.shanshui.XingYouShanShuiMgr;
import com.yanqu.road.server.manger.activity.share.ShareMgr;
import com.yanqu.road.server.manger.activity.shrek.DouLuoShrekMgr;
import com.yanqu.road.server.manger.activity.shuihu.ShuiHuMgr;
import com.yanqu.road.server.manger.activity.shushan.ShuShanMgr;
import com.yanqu.road.server.manger.activity.shushan.ShuShanRankActivityMgr;
import com.yanqu.road.server.manger.activity.signindraw.SignInDrawActivityMgr;
import com.yanqu.road.server.manger.activity.silkroad.SilkRoadMgr;
import com.yanqu.road.server.manger.activity.snowgarden.ActivityMallDayBuyMgr;
import com.yanqu.road.server.manger.activity.snowgarden.SnowGardenMgr;
import com.yanqu.road.server.manger.activity.sonhai.SonHaiActivityMgr;
import com.yanqu.road.server.manger.activity.springdinner.SpringDinnerMgr;
import com.yanqu.road.server.manger.activity.springdraw.SpringDrawMgr;
import com.yanqu.road.server.manger.activity.springunionbanquet.SpringUnionBanquetMgr;
import com.yanqu.road.server.manger.activity.starlight.StarLightMgr;
import com.yanqu.road.server.manger.activity.strongholdwar.StrongholdActivityMgr;
import com.yanqu.road.server.manger.activity.strongholdwar.StrongholdActivityRankMgr;
import com.yanqu.road.server.manger.activity.strongholdwar.StrongholdWarMgr;
import com.yanqu.road.server.manger.activity.summergames.SummerGamesActivityMgr;
import com.yanqu.road.server.manger.activity.summerquiz.SummerQuizActivityMgr;
import com.yanqu.road.server.manger.activity.suoyao.SuoYaoMgr;
import com.yanqu.road.server.manger.activity.tanghulu.TangHuLuMgr;
import com.yanqu.road.server.manger.activity.taobao.TaoBaoMgr;
import com.yanqu.road.server.manger.activity.throwingPot.ThrowingPotMgr;
import com.yanqu.road.server.manger.activity.tonbing.TonBingBugMgr;
import com.yanqu.road.server.manger.activity.tonbing.TonBingMgr;
import com.yanqu.road.server.manger.activity.tonbingchannel.ChannelTonBingMgr;
import com.yanqu.road.server.manger.activity.tongbing.ChuHanMgr;
import com.yanqu.road.server.manger.activity.tongbing.TongBingMgr;
import com.yanqu.road.server.manger.activity.toyhouse.ToyHouseMgr;
import com.yanqu.road.server.manger.activity.treasure.TreasureActivityMgr;
import com.yanqu.road.server.manger.activity.turtle.TurtleMgr;
import com.yanqu.road.server.manger.activity.twins.TwinsMgr;
import com.yanqu.road.server.manger.activity.unionchest.UnionChestMgr;
import com.yanqu.road.server.manger.activity.unionhuaben.UnionHuaBenActivityMgr;
import com.yanqu.road.server.manger.activity.unionwar.UnionPhaseWarMgr;
import com.yanqu.road.server.manger.activity.unionwar.UnionWarActivityMgr;
import com.yanqu.road.server.manger.activity.wanyao.WanYaoMgr;
import com.yanqu.road.server.manger.activity.washe.ChannelRankReloadMgr;
import com.yanqu.road.server.manger.activity.washe.WasheMgr;
import com.yanqu.road.server.manger.activity.wealthscroll.WealthScrollActivityMgr;
import com.yanqu.road.server.manger.activity.winterLove.WinterLoveMgr;
import com.yanqu.road.server.manger.activity.wishpool.WishPoolMgr;
import com.yanqu.road.server.manger.activity.witchdraw.WitchDrawMgr;
import com.yanqu.road.server.manger.activity.worldcup.WorldCupMgr;
import com.yanqu.road.server.manger.activity.xiaowuRecall.XiaowuRecallMgr;
import com.yanqu.road.server.manger.activity.xiayue.XiaYueMgr;
import com.yanqu.road.server.manger.activity.xiuxian.XiuXianMgr;
import com.yanqu.road.server.manger.activity.yearMaster.YearMasterMgr;
import com.yanqu.road.server.manger.activity.yingxin.YingXinMgr;
import com.yanqu.road.server.manger.activity.yuanbaolottery.YuanBaoLotteryMgr;
import com.yanqu.road.server.manger.activity.yqhotel.YqHotelMgr;
import com.yanqu.road.server.manger.activity.zhanling.ZhanLingActivityMgr;
import com.yanqu.road.server.manger.activity.zhenhuan.ZhenHuanConfigMgr;
import com.yanqu.road.server.manger.activity.zhenhuan.ZhenHuanMgr;
import com.yanqu.road.server.manger.activity.zhounianturntable.ZhouNianTurntableMgr;
import com.yanqu.road.server.manger.analyze.AnalyzeMgr;
import com.yanqu.road.server.manger.assistant.AssistantSkinMgr;
import com.yanqu.road.server.manger.banquet.*;
import com.yanqu.road.server.manger.beautyescort.BeautyEscortMgr;
import com.yanqu.road.server.manger.bug.ReduceGoodsMgr;
import com.yanqu.road.server.manger.config.*;
import com.yanqu.road.server.manger.config.grandchild.GrandChildConfigMgr;
import com.yanqu.road.server.manger.config.grandchild.GrandChildMgr;
import com.yanqu.road.server.manger.cross.CrossDataMgr;
import com.yanqu.road.server.manger.cross3.*;
import com.yanqu.road.server.manger.drugstore.DrugStoreConfigMgr;
import com.yanqu.road.server.manger.drugstore.DrugStoreMgr;
import com.yanqu.road.server.manger.giftKey.GiftKeyMgr;
import com.yanqu.road.server.manger.hunt.HuntMgr;
import com.yanqu.road.server.manger.kowloon.KowloonMgr;
import com.yanqu.road.server.manger.kuang.KuangMgr;
import com.yanqu.road.server.manger.location.IpMgr;
import com.yanqu.road.server.manger.location.LocationMgr;
import com.yanqu.road.server.manger.log.AutoLogMgr;
import com.yanqu.road.server.manger.log.LogMgr;
import com.yanqu.road.server.manger.maidian.UserBagGoodsChangeMgr;
import com.yanqu.road.server.manger.mail.ServerMailMgr;
import com.yanqu.road.server.manger.mammon.MammonMgr;
import com.yanqu.road.server.manger.mammon.MammonTypeSwitchMgr;
import com.yanqu.road.server.manger.manor.FishPondMgr;
import com.yanqu.road.server.manger.manor.ManorMgr;
import com.yanqu.road.server.manger.marriage.MarriageConfigMgr;
import com.yanqu.road.server.manger.marriage.MarriageMgr;
import com.yanqu.road.server.manger.match.MatchMgr;
import com.yanqu.road.server.manger.messagesubscribe.MessageSubscribeMgr;
import com.yanqu.road.server.manger.mogulbirthday.MogulBirthdayMgr;
import com.yanqu.road.server.manger.monopolymarket.MonopolyMarketMgr;
import com.yanqu.road.server.manger.notice.NoticeRecordMgr;
import com.yanqu.road.server.manger.palace.PalaceActivityMgr;
import com.yanqu.road.server.manger.patrons.PatronsSimpleCacheMgr;
import com.yanqu.road.server.manger.platform.PlatformUserBehaviorMgr;
import com.yanqu.road.server.manger.player.*;
import com.yanqu.road.server.manger.rank.ActivityRankMgr;
import com.yanqu.road.server.manger.rank.RankMgr;
import com.yanqu.road.server.manger.rank.YRankMgr;
import com.yanqu.road.server.manger.rebate.ChinaRebateMgr;
import com.yanqu.road.server.manger.rebate.RebateMgr;
import com.yanqu.road.server.manger.recharge.RechargeMgr;
import com.yanqu.road.server.manger.relatives.RelativesMgr;
import com.yanqu.road.server.manger.robot.RobotMgr;
import com.yanqu.road.server.manger.sacrifice.SacrificeMgr;
import com.yanqu.road.server.manger.scenecard.SceneCardMgr;
import com.yanqu.road.server.manger.sdk.ClientMsgPushMgr;
import com.yanqu.road.server.manger.sdk.TranslateLanguageMgr;
import com.yanqu.road.server.manger.season.SeasonRewardMgr;
import com.yanqu.road.server.manger.specialcookboy.SpecialCookBoyMgr;
import com.yanqu.road.server.manger.specialcookboy.SpecialCookBoySignMgr;
import com.yanqu.road.server.manger.specialserver.IceServerMgr;
import com.yanqu.road.server.manger.specialtombrob.ActivityDaySignMgr;
import com.yanqu.road.server.manger.specialtombrob.SpecialTombRobMgr;
import com.yanqu.road.server.manger.specialtombrob.SpecialTombRobSignMgr;
import com.yanqu.road.server.manger.statistics.StatisticsMgr;
import com.yanqu.road.server.manger.system.*;
import com.yanqu.road.server.manger.systemgroup.CrossSystemGroupMgr;
import com.yanqu.road.server.manger.systemgroup.newmonopolymarket.NewMonopolyMarketMgr;
import com.yanqu.road.server.manger.thirdparty.PlatformDataMgr;
import com.yanqu.road.server.manger.thirdparty.PlatformMgr;
import com.yanqu.road.server.manger.thirdparty.ThirdPartyMgr;
import com.yanqu.road.server.manger.union.*;
import com.yanqu.road.server.manger.union.huaben.UnionHuaBenMgr;
import com.yanqu.road.server.manger.unioncampwar.UnionCampWarPatronsMgr;
import com.yanqu.road.server.manger.wingroom.WingRoomChakraMgr;
import com.yanqu.road.server.manger.wingroom.WingRoomConfigMgr;
import com.yanqu.road.server.manger.wingroom.WingRoomMessageMgr;
import com.yanqu.road.server.manger.wingroom.WingRoomMgr;
import com.yanqu.road.server.manger.zhaoshang.ZsConfigMgr;
import com.yanqu.road.server.manger.zhaoshang.ZsMgr;
import com.yanqu.road.server.protocol.*;
import com.yanqu.road.server.timer.GeneralAgentTimerMgr;
import com.yanqu.road.server.webservice.GameWebServiceHelper;
import com.yanqu.road.thread.ThreadPoolHelper;
import com.yanqu.road.utils.ServerType;
import com.yanqu.road.utils.classutil.ScanningFileHelper;
import com.yanqu.road.utils.config.Config;
import com.yanqu.road.utils.executor.GeneralThreadFactory;
import com.yanqu.road.utils.executor.ScheduledThreadPoolHelper;
import com.yanqu.road.utils.monitor.MonitorHelper;
import com.yanqu.road.utils.string.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.io.File;
import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;
import java.lang.reflect.Field;
import java.util.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.atomic.AtomicInteger;

public final class GameServer extends TempServer {

    private static Logger logger = LogManager.getLogger(Class.class.getName());

    private static GameServer gameServer;

    private static ExecutorService serverCommandExecutor;

    private static ExecutorService sqlCommandExecutor;

    private boolean isStop;

    public boolean isStop() {
        return isStop;
    }

    public void setStop(boolean stop) {
        this.isStop = stop;
    }

    public static ExecutorService getServerCommandExecutor() {
        return serverCommandExecutor;
    }

    public static ExecutorService getSqlCommandExecutor() {
        return sqlCommandExecutor;
    }

    private GameServer() {

    }

    public static GameServer getInstance() {
        if (gameServer == null) {
            gameServer = new GameServer();
        }

        return gameServer;
    }

    @Override
    public boolean start() {
        //初始化定时器线程池
        initTimerExecutor();

        // 调整实际使用的消息处理线程数量
        serverCommandExecutor = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors() * 4,
                new GeneralThreadFactory("gameServer-cmd"));
        sqlCommandExecutor = Executors.newFixedThreadPool(2,
                new GeneralThreadFactory("gameServer-sqlCmd"));

        MonitorHelper.monitorPool("gameServer-cmd", (ThreadPoolExecutor) serverCommandExecutor);

        if (!super.start()) {
            return false;
        }

        if (!initGameModule(GameWebServiceHelper.getInstance().startGameWebService(), "init webService")) {
            return false;
        }

        if (!initGameModule(ThreadPoolHelper.init(), "init command thread pool")) {
            return false;
        }

       /* if (!initGameModule(DBManager.initConfig(ConfigHelper.getValue("db.path")), "load db")) {
            return false;
        }*/

        if (!initGameModule(initNetty(new GameServerHandler(), ServerType.SERVER_GAME), "init netty")) {
            return false;
        }
        logger.info("current path =  " + System.getProperty("user.dir"));
        logger.info("GameServer start success");



        //注册异常关闭处理过程
  /*      Runtime.getRuntime().addShutdownHook(new Thread(() -> {
            logger.info("GameServer kill 关闭服务器");
            GameServer.getInstance().newStop();
        }));*/
        return true;
    }

    private static void initTimerExecutor() {
        int corePoolSize = Runtime.getRuntime().availableProcessors() * 2;
        corePoolSize = Math.min(8, Math.max(4, corePoolSize));
        timerScheduledExecutorService = ScheduledThreadPoolHelper.createGameScheduledThreadPoolExecutor(corePoolSize, "timer-gameServer");
    }

    @Override
    public boolean stop() {
        try {
            //停止定时器
            logger.info("stop timer");
            GeneralAgentTimerMgr.stop();

            //保存玩家数据
            logger.info("save player data");
            ExecutorService stopSaveUserExecutor = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors() * 4,
                    new GeneralThreadFactory("gameServer-stop-save"));
            List<GamePlayer> playerList = GamePlayerMgr.getCopyPlayerList();
            AtomicInteger saveNum = new AtomicInteger(0);
            playerList.forEach(action -> stopSaveUserExecutor.execute(() -> {
                //保存活动逗留时间日志
                action.getModule(PlayerModule.class).saveActivityRemainTime();
                // 保存系统逗留时间日志
                action.getModule(PlayerModule.class).saveSystemRemainTime();
                action.saveData();
                saveNum.addAndGet(1);
            }));
            stopSaveUserExecutor.shutdown();
            logger.info("save mgr data");
            //保存mgr数据
            for (TempMgr baseMgr : GameServer.getInstance().getMgrList()) {
                try {
                    baseMgr.save();
                } catch (Exception ex) {
                    logger.error(ex);
                }

            }

            //保存log日志
            LogMgr.save();
            AutoLogMgr.stop();
            RedisSubPubRunner.setStop(true);
            LogMgr.saveServerDb();

            while (true) {
                if (stopSaveUserExecutor.isTerminated()) {
                    logger.warn("GameServer stop success");
                    logger.warn("saveNum: {}, totalNum: {}", saveNum.intValue(), playerList.size());
                    if (saveNum.intValue() == playerList.size()) {
                        super.stop();
                        break;
                    }
                }else {
                    Thread.sleep(1000);
                }
            }
            logger.warn("notify process stop success!");
        } catch (Exception e) {
            logger.error("GameServer stop error", e);
            return false;
        }

        return true;
    }

    public boolean newStop() {
        try {
            // 暂停30秒
            Thread.sleep(5000);
            //停止定时器
            logger.info("stop timer");
            GeneralAgentTimerMgr.stop();

            //保存玩家数据
            logger.info("save player data");
            ExecutorService stopSaveUserExecutor = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors() * 4,
                    new GeneralThreadFactory("gameServer-stop-save"));
            List<GamePlayer> playerList = GamePlayerMgr.getCopyPlayerList();
            AtomicInteger saveNum = new AtomicInteger(0);
            playerList.forEach(action -> stopSaveUserExecutor.execute(() -> {
                //保存活动逗留时间日志
                action.getModule(PlayerModule.class).saveActivityRemainTime();
                // 保存系统逗留时间日志
                action.getModule(PlayerModule.class).saveSystemRemainTime();
                action.saveData();
                saveNum.addAndGet(1);
            }));
            stopSaveUserExecutor.shutdown();
            logger.info("save mgr data");
            //保存mgr数据
            for (TempMgr baseMgr : GameServer.getInstance().getMgrList()) {
                try {
                    baseMgr.save();
                }catch (Exception e){
                    logger.error(e);
                }
            }

            //保存log日志
            LogMgr.save();
            AutoLogMgr.stop();
            RedisSubPubRunner.setStop(true);
            LogMgr.saveServerDb();

            while (true) {
                if (stopSaveUserExecutor.isTerminated()) {
                    logger.warn("GameServer stop success");
                    logger.warn("saveNum: {}, totalNum: {}", saveNum.intValue(), playerList.size());
                    if (saveNum.intValue() == playerList.size()) {
                        break;
                    }
                }else {
                    Thread.sleep(1000);
                }
            }
            logger.warn("notify process stop success!");
            logger.info("------------");
            logger.info("------------");
            logger.info("------------");
            logger.info("------------");
            // 关闭netty端口
            NettyMgr.newStop();
            logger.info("close netty port");
            // 关闭webService
            GameWebServiceHelper.getInstance().stopGameWebService();
            logger.info("close webService port");

            TempServer.deleteFile("./gameServer.pid");

            // 埋点关闭
            new DataAnalyticsMgr().stop();
            new KafKaHelperMgr().stop();

        } catch (Exception e) {
            logger.error("GameServer stop error", e);
            return false;
        }

        return true;
    }

    public static final int getProcessID() {
        RuntimeMXBean runtimeMXBean = ManagementFactory.getRuntimeMXBean();
        System.out.println(runtimeMXBean.getName());
        return Integer.valueOf(runtimeMXBean.getName().split("@")[0])
                .intValue();
    }

    public static void main(String[] args) {
        ePlayerAttrType.checkRepeatAttr();
    }

    public static void gameStart(String configFile) {
        checkCode();
        String dirPath = System.getProperty("user.dir") + File.separator;
        System.err.println(dirPath);
        long time = System.currentTimeMillis();

        cfgPath = configFile;
        TempServer gameServer = GameServer.getInstance();
        gameServer.setServerType(ServerType.SERVER_GAME);
        try {
            if (!gameServer.start()) {
                logger.error("GameServer start fail!");
                System.exit(1);
                return;
            }
        } catch (Exception e) {
            logger.error("GameServer start fail!");
            e.printStackTrace();
            System.exit(1);
            return;
        }
        DBTableInfoMgr dbTableInfoMgr = new DBTableInfoMgr();
        dbTableInfoMgr.init(DbNameStrategy.getLogDb(),"com.yanqu.road.entity.log",true);
        gameServer.setDbTableInfoMgr(dbTableInfoMgr);

        LogMgr.init();

        //初始化同步请求指令
        GamePlayerMgr.initGameServiceCommand();

        GeneralAgentTimerMgr.initGlobalTimers();

        logger.info("GameServer start success,cost time:" + (System.currentTimeMillis() - time));
        logger.info("notify process start success!");  //日志启动成功标识

        for (int i = 0; i < 100; i++) {
            logger.info("--------------");
        }
        logger.info("notify process start success!");  //日志启动成功标识
        System.err.println("processId:"+getProcessID());
    }

    private static void checkCode() {
        checkDuplicate(GameErrorCode.class);
        checkDuplicate(ClientProtocol.class);
        checkDuplicate(CrossProtocol.class);
        checkDuplicate(GameProtocol.class);
        checkDuplicate(AgentProtocol.class);
        ePlayerAttrType.checkRepeatAttr();
    }

    private static void checkDuplicate(Class clazz) {
        Field[] declaredFields = clazz.getDeclaredFields();
        Set<Integer> errorCodeSet = new HashSet<>();
        Set<Integer> duplicateErrorCodeSet = new HashSet<>();
        for (Field field : declaredFields) {
            try {
                Object aShort = field.get(clazz);
                int value = Integer.parseInt(aShort.toString());
                if (errorCodeSet.contains(value)) {
                    duplicateErrorCodeSet.add(value);
                }
                errorCodeSet.add(value);
            } catch (IllegalAccessException e) {
                throw new RuntimeException("check Code error: " + clazz.getSimpleName());
            }
        }
        if (duplicateErrorCodeSet.size() > 0) {
            System.err.println(duplicateErrorCodeSet);
            throw new RuntimeException("code duplicate:  " + clazz.getSimpleName() + "      " + duplicateErrorCodeSet);
        }
    }

    @Override
    public List<TempMgr> getMgrList() {
        List<TempMgr> mgrList = new ArrayList<>();
        //cmd 接口元数据
        if(Config.isDebug()){
            mgrList.add(new CmdMetaInfoMgr());
        }

        mgrList.add(new GameCheckConfigVersionMgr());
        //顺序别乱改
        //配置mgr放最前面
        mgrList.add(new ConfigManageMgr());
        mgrList.add(new ConfigMgr());
        mgrList.add(new ChannelVersionMgr());
        mgrList.add(new PackageVersionMgr());
        mgrList.add(new HotPackVersionMgr());
        mgrList.add(new ChannelHotUpdateConfigMgr());
        mgrList.add(new ServerListMgr());
        mgrList.add(new LightMsgMgr());
        mgrList.add(new DataUploadInfoMgr());
        mgrList.add(new AppKeyMgr());
        mgrList.add(new ChannelConfigMgr(sType));
        mgrList.add(new GameChannelSystemConfigMgr());
        mgrList.add(new ServerConfigMgr());
        mgrList.add(new MultipleLanguageMgr());
        mgrList.add(new ServerLanguageMgr());
        mgrList.add(new TitleMgr());
        mgrList.add(new GoodsMgr());
        mgrList.add(new GoodsBagMgr());
        mgrList.add(new TempGoodsBagMgr());
        mgrList.add(new HideGoodsMgr());
        mgrList.add(new CommonMgr());
        mgrList.add(new MessageSubscribeMgr());
        mgrList.add(new PlatformGoodsMgr());
        mgrList.add(new BuildingMgr());
        mgrList.add(new CollectionMgr());
        mgrList.add(new ForbiddenMgr());
        mgrList.add(new TaskMgr());
        mgrList.add(new OldTaskChangeMgr());
        mgrList.add(new MallMgr());
        mgrList.add(new MallRechargeConfigMgr());
        mgrList.add(new VipMgr());
        mgrList.add(new NameMgr());
        mgrList.add(new SystemOpenMgr());
        mgrList.add(new ChildMgr());
        mgrList.add(new BeautyMgr());
        mgrList.add(new SkillMgr());
        mgrList.add(new PatronsMgr());
        mgrList.add(new VehicleMgr());
        mgrList.add(new VehicleSoulMgr());
        mgrList.add(new VehicleBoneConfigMgr());
        mgrList.add(new DecorationMgr());
        mgrList.add(new AgentInterfaceMgr());
        mgrList.add(new IpMgr());
        mgrList.add(new ForbiddenWordMgr());
        mgrList.add(new WhiteIpMgr());
        mgrList.add(new PlatformUserIdMgr());
        mgrList.add(new LocationMgr());
        mgrList.add(new MarriageConfigMgr());
        mgrList.add(new TradeWarConfigMgr());
        mgrList.add(new TravelMgr());
        mgrList.add(new MineWarConfigMgr());
        mgrList.add(new EstateWarConfigMgr());
        mgrList.add(new HouseMgr());
        mgrList.add(new CrossUnionServerGroupMgr());
        mgrList.add(new UnionHuaBenServerGroupMgr());
        mgrList.add(new UnionConfigMgr());
        mgrList.add(new CrossUnionMgr());
        mgrList.add(new UnionHuaBenMgr());
        mgrList.add(new ZsConfigMgr());
        mgrList.add(new PrivilegeCardMgr());
        mgrList.add(new HuntConfigMgr());
        mgrList.add(new SacrificeConfigMgr());
        mgrList.add(new BanquetConfigMgr());
        mgrList.add(new ServerGroupMgr());
        mgrList.add(new ServerGroup2Mgr());
        mgrList.add(new CrossServerGroupMgr());
        mgrList.add(new EscortServerGroupMgr());
        mgrList.add(new BeautyEscortConfigMgr());
        mgrList.add(new SystemCrossServerGroupMgr());
        mgrList.add(new BeautyEscortMgr());
        mgrList.add(new CrossMarriageGroupMgr());
        mgrList.add(new MammonConfigMgr());
        mgrList.add(new SkinMgr());
        mgrList.add(new CharitableWorkMgr());
        mgrList.add(new MatchMgr());
        mgrList.add(new MatchServerGroupMgr());
        mgrList.add(new CricketServerGroupMgr());
        mgrList.add(new RechargeMgr());
        mgrList.add(new PromotionMgr());
        mgrList.add(new RechargeSwitchConfigMgr());
        mgrList.add(new GrandChildConfigMgr());
        mgrList.add(new MammonTypeSwitchMgr());
        mgrList.add(new WhiteWordMgr());
        mgrList.add(new TokenOrderWhiteMgr());
        mgrList.add(new MiniGameConfigMgr());
        mgrList.add(new GameEditLimitMgr());
        mgrList.add(new MallRebateMgr());
        mgrList.add(new GameSystemLoopMgr());

        mgrList.add(new CricketMgr());
        mgrList.add(new IntroductionShieldMgr());
        mgrList.add(new SequentialMessageExecuterMgr());
        //逻辑mgr
        mgrList.add(new ServerMailMgr());
        mgrList.add(new GamePlayerMgr());
        mgrList.add(new UserMgr());
        mgrList.add(new ActivityItemRecycleMgr());
        mgrList.add(new MarriageMgr());
        //mgrList.add(new UnionMgr());
        mgrList.add(new CrossUnionNotifyMgr());
        mgrList.add(new MammonMgr());
        mgrList.add(new WorldMessageMgr());
        mgrList.add(new ChatConfigMgr());
        mgrList.add(new TradeWarMgr());
        mgrList.add(new MineWarMgr());
        mgrList.add(new EstateWarMgr());
        mgrList.add(new TurntableMgr());
        mgrList.add(new InnerUserMgr());
        //mgrList.add(new UnionNoticeMgr());
        //mgrList.add(new UnionJoinApplyMgr());
        //mgrList.add(new UnionTradeMgr());
        mgrList.add(new ZsMgr());
        mgrList.add(new CurioConfigMgr());
        mgrList.add(new CurioMgr());
        mgrList.add(new RankMgr());
        mgrList.add(new ActivityBulletScreenMgr());
        mgrList.add(new NormalActivityMgr());
        mgrList.add(new MallActivityMgr());
        mgrList.add(new CommonActivityMgr());
        mgrList.add(new CommonActivityRankMgr());
        mgrList.add(new HolidayActivityMgr());
        mgrList.add(new TradeWarActivityMgr());
        mgrList.add(new TradeWarActivityRankMgr());
        mgrList.add(new OreWarActivityMgr());
        mgrList.add(new OreWarActivityRankMgr());
        mgrList.add(new GamePageantMgr());
        mgrList.add(new HuaShiGangMgr());
        mgrList.add(new StrongholdActivityMgr());
        mgrList.add(new StrongholdActivityRankMgr());
        mgrList.add(new ActivityRankMgr());
        mgrList.add(new ThrowingPotMgr());
        mgrList.add(new DishesMgr());
        mgrList.add(new WishPoolMgr());
        mgrList.add(new YearMasterMgr());
        mgrList.add(new TreasureActivityMgr());
        mgrList.add(new DrawPicturesActivityMgr());
        mgrList.add(new DaFuWengMgr());
        mgrList.add(new TangHuLuMgr());
        mgrList.add(new BowArtMgr());
        mgrList.add(new GeneralActivityRankMgr());
        mgrList.add(new ShuiHuMgr());
        mgrList.add(new BusyFarmingMgr());
        mgrList.add(new PatronsSimpleCacheMgr());
        mgrList.add(new StatisticsMgr());
        mgrList.add(new GhostMgr());
        mgrList.add(new ZhanLingActivityMgr());
        mgrList.add(new SuoYaoMgr());
        mgrList.add(new HangHaiMgr());
        mgrList.add(new GuGuoXunBaoMgr());
        mgrList.add(new ThiefMgr());
        mgrList.add(new DragonBoatRaceMgr());
        mgrList.add(new HideMallMgr());
        mgrList.add(new XiaYueMgr());
        mgrList.add(new CelebrationMgr());
        mgrList.add(new GourdChildMgr());
        mgrList.add(new GourdPlantMgr());
        mgrList.add(new MonopolyMarketMgr());
        mgrList.add(new NewMonopolyMarketMgr());
        mgrList.add(new WinterLoveMgr());
        mgrList.add(new XiaowuRecallMgr());
        mgrList.add(new GrandChildMgr());
        mgrList.add(new DouLuoDaLuMgr());
        mgrList.add(new SeacraftPirateRiotMgr());
        mgrList.add(new TaoBaoMgr());
        mgrList.add(new ToyHouseMgr());
        mgrList.add(new UnionHuaBenActivityMgr());
        mgrList.add(new SoulBoneActivityMgr());

        //按照这个顺序，需要常驻内存的活动加下去
        mgrList.add(new RelationActivityMgr());
        mgrList.add(new RelationActivityRankMgr());
        mgrList.add(new CookBoyActivityMgr());
        mgrList.add(new OtherActivityBoyActivityMgr());
        mgrList.add(new CookBoyMgr());
        mgrList.add(new LanRuoSiMgr());
        mgrList.add(new HellMgr());
        mgrList.add(new DouLuoShrekMgr());
        mgrList.add(new SpringDinnerMgr());
        mgrList.add(new OldPlayerReturnMgr());
        mgrList.add(new PalaceActivityMgr());
        mgrList.add(new AssistantCostumeMallActivityMgr());
        mgrList.add(new DrugStoreConfigMgr());
        mgrList.add(new DrugStoreMgr());
        mgrList.add(new OperaMaskMgr());
        mgrList.add(new NewServerWelfareMgr());
        mgrList.add(new FellingTreesMgr());
        mgrList.add(new WasheMgr());
        mgrList.add(new EggsActivityMgr());
        mgrList.add(new AdActivityMgr());
        mgrList.add(new SpecialCookBoyMgr());
        mgrList.add(new SpecialCookBoySignMgr());
        mgrList.add(new ChannelRankReloadMgr());
        mgrList.add(new AdvertisementActivityMgr());
        mgrList.add(new ActivityMallDayBuyMgr());
        //所有新加的活动必须加在下面的上面
        mgrList.add(new ActivityMgr());
        mgrList.add(new GameUnionActivityGroupMgr()); // 商会活动分组，放在活动加载完、各个商会活动加载前
        mgrList.add(new AutoSendActivity());
        mgrList.add(new UnionActivityMgr());
        mgrList.add(new UnionActivityTaskMgr());
        mgrList.add(new InteractiveMgr());
        mgrList.add(new HuntMgr());
        mgrList.add(new SacrificeMgr());
        mgrList.add(new SystemSwitchMgr());
        mgrList.add(new AnalyzeMgr());             //报告日志
        mgrList.add(new BanquetMgr());
        mgrList.add(new CrossDataMgr());
        mgrList.add(new ActivityDisperseGoldMgr());
        mgrList.add(new DisperseGoldMgr());
        mgrList.add(new RelativesMgr());
        mgrList.add(new ThirdPartyMgr());
        mgrList.add(new PlatformMgr());
        mgrList.add(new CrossBanquetMgr());
        mgrList.add(new BanquetRelationshipMgr());
        mgrList.add(new CrossBanquetAutoOpenMgr());
        mgrList.add(new RebateMgr());
        mgrList.add(new ChinaRebateMgr());
        mgrList.add(new UnionParergonMgr());
        mgrList.add(new PassRoadMgr());
        mgrList.add(new ActivityAutoRewardMgr());
        mgrList.add(new NpcConfigMgr());
        mgrList.add(new OreWarMgr());
        mgrList.add(new StrongholdWarMgr());
        mgrList.add(new NoticeRecordMgr());
        mgrList.add(new GiftKeyMgr());
        mgrList.add(new ActivityIgnoreMgr());   //屏蔽活动
        mgrList.add(new UnionWarActivityMgr());
        mgrList.add(new UnionPhaseWarMgr());
        mgrList.add(new ClinicMgr());
        mgrList.add(new PawnshopMgr());
        mgrList.add(new ClientMsgPushMgr());
        mgrList.add(new TranslateLanguageMgr());
        mgrList.add(new RobotMgr());
        mgrList.add(new SkinVolumeMgr());//霓裳卷
        mgrList.add(new ManorMgr());
        mgrList.add(new MammonHallMgr());
        mgrList.add(new WineShopMgr());
        mgrList.add(new FishPondMgr()); //鱼塘
        mgrList.add(new AssistantSkinMgr());
        mgrList.add(new WingRoomConfigMgr()); //厢房
        mgrList.add(new WingRoomMgr());
        mgrList.add(new WingRoomMessageMgr());
        mgrList.add(new MogulBirthdayMgr());
        mgrList.add(new ALiPayReportMgr());

        mgrList.add(new PiXiuActivityMgr());
        mgrList.add(new ClimbTowerMgr());
        mgrList.add(new ChannelActivityMgr()); // 跨地区活动
        mgrList.add(new ChannelActivitySwitchMgr()); // 跨地区活动开关
        mgrList.add(new ChannelRankActivityMgr()); // 跨地区冲榜活动
        mgrList.add(new GameXRankMgr()); // 跨地区活动榜单
        mgrList.add(new GameXServerNameMgr()); // 跨地区服务器名称
        mgrList.add(new ActivityAbleMgr()); // 活动凭证
        mgrList.add(new ActivityChatMgr());
        //
        mgrList.add(new DAServerListMgr());
        mgrList.add(new DataAnalyticsMgr());
        mgrList.add(new KafKaHelperMgr());
        mgrList.add(new UserBagGoodsChangeMgr());
        mgrList.add(new MonopolyMarketRankActivityMgr());
        mgrList.add(new ForbiddenIpMgr());
        mgrList.add(new YingXinMgr());
        mgrList.add(new ShareMgr());
        mgrList.add(new ShuShanMgr());
        mgrList.add(new ShuShanRankActivityMgr());
        mgrList.add(new MemoryPiecesMgr());
        mgrList.add(new ZhouNianTurntableMgr());
        mgrList.add(new BusinessReunionActivityMgr());  //商海重逢
        mgrList.add(new BusinessReunionMgr());
        mgrList.add(new RecallPlayerMgr());

        mgrList.add(new TongBingMgr());
        mgrList.add(new RankUnionWarMgr());
        mgrList.add(new TwinsMgr());
        mgrList.add(new PlatformActivityMgr());
        mgrList.add(new BadgeMgr());
        mgrList.add(new PlatformUserBehaviorMgr());
        //加载酒坊相关的配置
        mgrList.add(new WineryConfigMgr());
        mgrList.add(new BadgeConfigMgr());
        mgrList.add(new PlatformMailAntiActivityMgr());

        mgrList.add(new GoldAutumnMgr());
        mgrList.add(new WhiteListLocationMgr());
        mgrList.add(new PastureMgr());
        mgrList.add(new CrossPastureMgr());
        mgrList.add(new LionDanceMgr());
        mgrList.add(new TombMgr());
        mgrList.add(new GreatTradeMgr());
        mgrList.add(new CatMgr());
        mgrList.add(new CarpTripMgr());
        mgrList.add(new FanXiuSpringMgr());
        mgrList.add(new CommonWishMgr());
        mgrList.add(new SmallGameConfigMgr());
        mgrList.add(new MusicRoomConfigMgr());

        mgrList.add(new SeasonRewardMgr());
        mgrList.add(new WorldCupMgr());
        mgrList.add(new SqlCacheMgr());

        mgrList.add(new LuckyDrawMgr());
        mgrList.add(new LangYaMemorialMgr());
        //巅峰据点战
        mgrList.add(new PeakStrongholdActivityMgr());
        mgrList.add(new BlacklistMgr());

        mgrList.add(new SpringUnionBanquetMgr());

        mgrList.add(new NewYearBagMgr());
        mgrList.add(new GoddessMgr());
        mgrList.add(new FlowerCardsMgr());
        mgrList.add(new XiuXianMgr());
        mgrList.add(new SignInDrawActivityMgr());
        mgrList.add(new ReduceGoodsMgr());
        mgrList.add(new VerificationConfigMgr());
        mgrList.add(new ShanHeFeastMgr());


        //巅峰海上争霸
        mgrList.add(new PeakSeacraftMgr());
        //巅峰统兵
        mgrList.add(new TonBingMgr());
        mgrList.add(new TonBingBugMgr());
        mgrList.add(new ChannelTonBingMgr());
        //商会宝箱
        mgrList.add(new UnionChestMgr());

        mgrList.add(new RecoveryRewardMgr());

        mgrList.add(new KowloonMgr());

        mgrList.add(new YRankMgr());

        mgrList.add(new AreaWasePkMgr());

        // 南海丝路
        mgrList.add(new SilkRoadMgr());

        mgrList.add(new ActivityInfoMgr());
        mgrList.add(new UnionCampWarPatronsMgr());

        mgrList.add(new GameChatControlMgr());
        mgrList.add(new DestroyRoleMgr());

        mgrList.add(new KuangMgr());
        mgrList.add(new QixiMgr());
        mgrList.add(new GuaGiftsMgr());
        mgrList.add(new CrossSystemGroupMgr());

        mgrList.add(new WanYaoMgr());

        mgrList.add(new TopicLinkMgr());

        mgrList.add(new DigGoldMgr());

        mgrList.add(new SpecialTombRobMgr());

        mgrList.add(new SpecialTombRobSignMgr());

        mgrList.add(new EveFeastMgr());

        //盗墓笔记
        mgrList.add(new DaoMuActivityMgr());

        mgrList.add(new WitchDrawMgr());

        mgrList.add(new LangYaBangMgr());

        mgrList.add(new JinLiMgr());

        //厢房命盘
        mgrList.add(new WingRoomChakraMgr());

        mgrList.add(new WechatBindMgr());

        mgrList.add(new PlatformDataMgr());
        //妙音坊冲榜
        mgrList.add(new MusicRoomRankActivityMgr());

        // 九州棋局
        mgrList.add(new JiuZhouMgr());

        mgrList.add(new SnowGardenMgr());

        mgrList.add(new LuckyShopMgr());

        mgrList.add(new RuiShouMgr());

        mgrList.add(new HongXianActivityMgr());

        mgrList.add(new ZhenHuanConfigMgr());
        mgrList.add(new ZhenHuanMgr());

        mgrList.add(new ActivityDaySignMgr());

        mgrList.add(new BiaoJuConfigMgr());

        //花袭春意
        mgrList.add(new SpringDrawMgr());
        mgrList.add(new FoxCardMgr());

        mgrList.add(new SummerGamesActivityMgr());
        mgrList.add(new SummerQuizActivityMgr());

        // 抖音场景卡推送
        mgrList.add(new SceneCardMgr());

        //商途启程
        mgrList.add(new BusinessDepartMgr());

        // 高山鸣琴
        mgrList.add(new HarpsMgr());

        mgrList.add(new PlayerInfoChangeNotifyMgr());
        mgrList.add(new AutoOpenServerMgr());

        mgrList.add(new QQPrivilegeMgr());

        //微信排行
        mgrList.add(new WechatRankBlackUserMgr());


        //通用战令
        mgrList.add(new ActivityFundMgr());

        //通用组队
        mgrList.add(new CommonTeamMgr());

        //山海伏兽
        mgrList.add(new SonHaiActivityMgr());

        //海神岛
        mgrList.add(new HsIslandActivityMgr());

        // 乌龟对对碰
        mgrList.add(new TurtleMgr());

        //小马快跑
        mgrList.add(new HorseRunMgr());

        //跳棋火锅
        mgrList.add(new HotpotJumpMgr());

        // 幸运扭蛋
        mgrList.add(new GashaponMgr());

        //元宝多多
        mgrList.add(new GoldIngotFundMgr());

        // 星星点灯
        mgrList.add(new StarLightMgr());

        // 爱徒养成
        mgrList.add(new ApprenticeMgr());

        //元宝招财
        mgrList.add(new YuanBaoLotteryMgr());

        // 新财神密卷
        mgrList.add(new WealthScrollActivityMgr());

        mgrList.add(new XingYouShanShuiMgr());

        mgrList.add(new ChuHanMgr());

        mgrList.add(new ActivityRmbMallTouchMgr());

        mgrList.add(new ChefDuelActivityMgr());
        mgrList.add(new ChefDuelMgr());

        // 寒冬汴梁
        mgrList.add(new IceServerMgr());
        //厨神对决一阶段
        mgrList.add(new ChefDuelPhase1Mgr());

        //阳泉酒家
        mgrList.add(new YqHotelMgr());
        // 寒冬馈赠
        mgrList.add(new IceServerGiftMgr());

        //跨域百花争艳(妙音坊冲榜)
        mgrList.add(new ChannelMusicRoomRankActivityMgr());
        //通用自选抽奖
        mgrList.add(new SelectLotteryMgr());

        return mgrList;
    }

}
